package com.lkd.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lkd.entity.Partner;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface PartnerMapper  extends BaseMapper<Partner> {

    /**
     * 新增合作商
     *
     * @return
     */
    int insert(Partner partner);

    /**
     * 查询合作商
     */
    List<Partner> queryPartnerByName(String name);

    /**
     * 根据id查询合作商
     */
    @Select("select * from tb_partner where id = #{partnerId}")
    Partner getPartnerById(String partnerId);

    /**
     * 修改合作商
     */
    boolean update(Partner partner);

    /**
     * 删除合作商
     */
    @Delete("delete from tb_partner where id = #{id}")
    boolean delete(String id);
}
